package com.zr.serviceimpl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zr.dao.UserdaoSCM;
import com.zr.model.User;
import com.zr.service.UserService;

@Service("userService")
public class UserServiceimpl implements UserService{	
	//属性注入
	@Resource
	private  UserdaoSCM  userDao;
	
	
	
	/**
	 * 账号验证
	 * 
	 * */	
	@Override
	public int findUidByUname(String uname) {	
		int uid=userDao.findUidByUname(uname);
		return uid;
	}
	/**
	 * 登录验证
	 * 
	 * */
	@Override
	public User findUidByUnameAndUpw(String uname, String upw) {
		User u=userDao.findUidByUnameAndUpw(uname, upw);
		return u;
	}

	/**
	 * 登录之后修改状态，实行单点登录
	 * */	
	@Override
	public void updateUserUstate(int uid) {
		userDao.updateUserUstate(uid);
	}
	
	
	
	/**
	 * 退出系统
	 * */	
	@Override
	public void updatesignOutSystem(int uid) {
		userDao.updatesignOutSystem(uid);
	}

	
}
